#include <sstream>
#include <iostream>
using std::cout;
using std::endl;
using std::istringstream;
using std::string;

void test0(){
    string str("123 456");
    int number = 0, number2 = 0;
    //iss代表流对象，创建时就绑定str这个字符串
    istringstream iss(str);
    //将字符串转换成其他类型
    //输入流运算符会把空格、换行当做分隔符
    iss >> number >> number2;
    cout << "number:" << number << endl;
    cout << "number2:" << number2 << endl;
}

int main(void){
    test0();
    return 0;
}
